package com.ruoyi.patrol.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.patrol.mapper.PtCheckTypeMapper;
import com.ruoyi.patrol.domain.PtCheckType;
import com.ruoyi.patrol.service.IPtCheckTypeService;

/**
 * 专项检查类型Service业务层处理
 *
 * @author Du
 * @date 2023-11-18
 */
@Service
public class PtCheckTypeServiceImpl implements IPtCheckTypeService {
    @Autowired
    private PtCheckTypeMapper ptCheckTypeMapper;

    /**
     * 查询专项检查类型
     *
     * @param id 专项检查类型ID
     * @return 专项检查类型
     */
    @Override
    public PtCheckType selectPtCheckTypeById(Long id) {
        return ptCheckTypeMapper.selectPtCheckTypeById(id);
    }

    /**
     * 查询专项检查类型列表
     *
     * @param ptCheckType 专项检查类型
     * @return 专项检查类型
     */
    @Override
    public List<PtCheckType> selectPtCheckTypeList(PtCheckType ptCheckType) {
        return ptCheckTypeMapper.selectPtCheckTypeList(ptCheckType);
    }

    /**
     * 新增专项检查类型
     *
     * @param ptCheckType 专项检查类型
     * @return 结果
     */
    @Override
    public int insertPtCheckType(PtCheckType ptCheckType) {
        ptCheckType.setCreateTime(DateUtils.getNowDate());
        return ptCheckTypeMapper.insertPtCheckType(ptCheckType);
    }

    /**
     * 修改专项检查类型
     *
     * @param ptCheckType 专项检查类型
     * @return 结果
     */
    @Override
    public int updatePtCheckType(PtCheckType ptCheckType) {
        ptCheckType.setUpdateTime(DateUtils.getNowDate());
        return ptCheckTypeMapper.updatePtCheckType(ptCheckType);
    }

    /**
     * 批量删除专项检查类型
     *
     * @param ids 需要删除的专项检查类型ID
     * @return 结果
     */
    @Override
    public int deletePtCheckTypeByIds(Long[] ids) {
        return ptCheckTypeMapper.deletePtCheckTypeByIds(ids);
    }

    /**
     * 删除专项检查类型信息
     *
     * @param id 专项检查类型ID
     * @return 结果
     */
    @Override
    public int deletePtCheckTypeById(Long id) {
        return ptCheckTypeMapper.deletePtCheckTypeById(id);
    }
}
